package com.example.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class UserPage extends InternalPage {

	@FindBy(css = "input[id = \"password\"]")
	public WebElement userPasswordField;
	
	@FindBy(css = "input[id = \"password2\"]")
	public WebElement userPasswordAgainField;
	
	@FindBy(css = "input[name= \"submit\"]")
	public WebElement saveButton;
	
	public UserPage changePassword(String password) {
		userPasswordField.sendKeys(password);
		userPasswordAgainField.sendKeys(password);
		saveButton.click();
		return MyPageFactory.getPage(driver, UserPage.class);
    }
}
